/* jshint indent: 2 */

module.exports = function(sequelize, DataTypes) {
  return sequelize.define('fProduct', {
    id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
      field: 'id'
    },
    name: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'name'
    },
    price: {
      type: "DOUBLE(10,2)",
      allowNull: true,
      defaultValue: '0.00',
      field: 'price'
    },
    description: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'description'
    },
    imageUrl: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'image_url'
    },
    disCount: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'dis_count'
    },
    invalid: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'invalid'
    },
    createTime: {
      type: DataTypes.DATE,
      allowNull: true,
      field: 'create_time'
    },
    hasActivity: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'has_activity'
    },
    stageIntegral: {
      type: DataTypes.INTEGER(120),
      allowNull: true,
      defaultValue: '0',
      field: 'stage_integral'
    },
    recommenderIntegral: {
      type: DataTypes.INTEGER(120),
      allowNull: true,
      defaultValue: '0',
      field: 'recommender_integral'
    },
    signInTime: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      defaultValue: '0',
      field: 'sign_in_time'
    },
    postage: {
      type: DataTypes.INTEGER(100),
      allowNull: true,
      defaultValue: '0',
      field: 'postage'
    },
    recommenderSignInTime: {
      type: DataTypes.INTEGER(120),
      allowNull: true,
      defaultValue: '0',
      field: 'recommender_sign_in_time'
    },
    type: {
      type: DataTypes.INTEGER(1),
      allowNull: true,
      defaultValue: '0',
      field: 'type'
    },
    infoImageUrl: {
      type: DataTypes.STRING(255),
      allowNull: true,
      field: 'info_image_url'
    },
    purchaseLimit: {
      type: DataTypes.INTEGER(11),
      allowNull: true,
      defaultValue: '1',
      field: 'purchase_limit'
    }
  }, {
    tableName: 'f_product'
  });
};
